<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Docker 配置编辑器</title>
    <link rel="icon" href="img/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/theme/dracula.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="styles.css">
</head>
<body class="dark-mode">
    <!-- 开屏动画 -->
    <div id="splash-screen">
        <div class="splash-logo">
            <i class="fab fa-docker"></i>
            <h2>Docker & Nginx 配置编辑器</h2>
            <div class="spinner"></div>
        </div>
        <div class="splash-left"></div>
        <div class="splash-right"></div>
    </div>
    
    <div class="container">
        <!-- 原有内容保持不变 -->

    <div class="container">
        <header>
            <div class="header-top">
                <h1><i class="fab fa-docker"></i> Docker & Nginx 配置编辑器</h1>
                <p class="description">可视化编辑 Docker Compose、Dockerfile 和 Nginx 配置，使用模板快速开始项目</p>
                <div class="header-controls">
                    <div class="wallpaper-controls">
                        <button id="change-wallpaper" class="btn btn-secondary">
                            <i class="fas fa-image"></i> 更换壁纸
                        </button>
                    </div>
                    <div class="theme-toggle">
                        <button id="theme-switcher" class="btn btn-secondary">
                            <span class="theme-icon"><i class="fas fa-sun"></i></span> 亮色模式
                        </button>
                    </div>
                </div>
            </div>
        </header>
        
        <div class="main-content">
            <div class="view-tabs">
                <div class="view-tab active" data-view="compose">
                    <i class="fas fa-code"></i> Docker Compose
                </div>
                <div class="view-tab" data-view="dockerfile">
                    <i class="fas fa-file-code"></i> Dockerfile
                </div>
                <div class="view-tab" data-view="nginx">
                    <i class="fas fa-server"></i> Nginx
                </div>
            </div>
            
            <!-- Docker Compose 视图 -->
            <div class="editor-view active" id="compose-view">
                <div class="templates-sidebar">
                    <h2><i class="fas fa-layer-group"></i> Compose 模板</h2>
                    <div id="compose-templates-container"></div>
                </div>
                
                <div class="editor-container">
                    <div class="editor-header">
                        <button class="btn-editor-action" data-action="clear" data-editor="compose">
                            <i class="fas fa-trash"></i> 清除
                        </button>
                        <button class="btn-editor-action" data-action="save" data-editor="compose">
                            <i class="fas fa-download"></i> 保存
                        </button>
                        <button class="btn-editor-action" data-action="copy" data-editor="compose">
                            <i class="fas fa-copy"></i> 复制
                        </button>
                    </div>
                    <textarea id="compose-editor" placeholder="在此编辑 docker-compose.yml..." autofocus></textarea>
                </div>
                
                <div class="parameters-sidebar">
                    <h2><i class="fas fa-sliders-h"></i> Compose 参数</h2>
                    <div id="compose-parameters-container"></div>
                </div>
            </div>
            
            <!-- Dockerfile 视图 -->
            <div class="editor-view" id="dockerfile-view">
                <div class="templates-sidebar">
                    <h2><i class="fas fa-layer-group"></i> Dockerfile 模板</h2>
                    <div id="dockerfile-templates-container"></div>
                </div>
                
                <div class="editor-container">
                    <div class="editor-header">
                        <button class="btn-editor-action" data-action="clear" data-editor="dockerfile">
                            <i class="fas fa-trash"></i> 清除
                        </button>
                        <button class="btn-editor-action" data-action="save" data-editor="dockerfile">
                            <i class="fas fa-download"></i> 保存
                        </button>
                        <button class="btn-editor-action" data-action="copy" data-editor="dockerfile">
                            <i class="fas fa-copy"></i> 复制
                        </button>
                    </div>
                    <textarea id="dockerfile-editor" placeholder="在此编辑 Dockerfile..."></textarea>
                </div>
                
                <div class="parameters-sidebar">
                    <h2><i class="fas fa-sliders-h"></i> Dockerfile 参数</h2>
                    <div id="dockerfile-parameters-container"></div>
                </div>
            </div>
            
            <!-- Nginx 视图 -->
            <div class="editor-view" id="nginx-view">
                <div class="templates-sidebar">
                    <h2><i class="fas fa-layer-group"></i> Nginx 模板</h2>
                    <div id="nginx-templates-container"></div>
                </div>
                
                <div class="editor-container">
                    <div class="editor-header">
                        <button class="btn-editor-action" data-action="clear" data-editor="nginx">
                            <i class="fas fa-trash"></i> 清除
                        </button>
                        <button class="btn-editor-action" data-action="save" data-editor="nginx">
                            <i class="fas fa-download"></i> 保存
                        </button>
                        <button class="btn-editor-action" data-action="copy" data-editor="nginx">
                            <i class="fas fa-copy"></i> 复制
                        </button>
                    </div>
                    <textarea id="nginx-editor" placeholder="在此编辑 Nginx 配置..."></textarea>
                </div>
                
                <div class="parameters-sidebar">
                    <h2><i class="fas fa-sliders-h"></i> Nginx 参数</h2>
                    <div id="nginx-parameters-container"></div>
                </div>
            </div>
            
            <!-- 模板预览 -->
            <div id="template-preview" class="template-preview">
                <h3 id="preview-title">模板预览</h3>
                <pre id="preview-content"></pre>
                <div class="actions">
                    <button class="btn btn-secondary" id="cancel-preview">
                        <i class="fas fa-times"></i> 取消
                    </button>
                    <button class="btn btn-primary" id="apply-template">
                        <i class="fas fa-check"></i> 应用模板
                    </button>
                </div>
            </div>
        </div>
        
        <footer>
            <p>Docker & Nginx 配置编辑器 &copy; 2023 - 使用模板快速创建配置文件</p>
        </footer>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/yaml/yaml.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/dockerfile/dockerfile.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/nginx/nginx.min.js"></script>
    
    <!-- 模板数据 -->
    <script src="docker-compose-mould.js"></script>
    <script src="dockerfile-mould.js"></script>
    <script src="nginx-mould.js"></script>
    
    <!-- 参数数据 -->
    <script src="docker-compose-parameter.js"></script>
    <script src="dockerfile-parameter.js"></script>
    <script src="nginx-parameter.js"></script>
    
    <script src="script.js"></script>
</body>
</html>